package com.project.lk.nurseapp.utils;

import android.graphics.drawable.AnimationDrawable;
import android.text.TextUtils;
import android.view.View;

import com.project.lk.nurseapp.R;


/**
 * 功能介绍：
 * 项目名：
 * 模块名称：
 * 作者：LK
 * 日期：2018/1/9
 * 修改日期：
 */
public class VoiceAnimUtils {

    public static void playVoiceAnim(View view, View convertView, int  viewType){
        if (view!= null) {
            if (viewType==0){
                view .setBackgroundResource(R.drawable.ht01_voice03);
            }else {
                view .setBackgroundResource(R.drawable.ht_voice03);
            }

            view= null;
        }
        view=  convertView.findViewById(R.id.recoder_anim);
        if (viewType==0){
            view .setBackgroundResource(R.drawable.play_anim_left);
        }else {
            view .setBackgroundResource(R.drawable.play_anim_right);
        }

        AnimationDrawable animation = (AnimationDrawable)view.getBackground();
        animation.start();
    }

    public static void StopVoiceAnim(View view,View convertView,int viewType){
        if (view!= null) {
            if (viewType==0){
                view .setBackgroundResource(R.drawable.ht01_voice03);
            }else {
                view .setBackgroundResource(R.drawable.ht_voice03);
            }
            view= null;
        }
        view= convertView.findViewById(R.id.recoder_anim);
        if (viewType==0){
            view .setBackgroundResource(R.drawable.play_anim_left);
        }else {
            view .setBackgroundResource(R.drawable.play_anim_right);
        }

        AnimationDrawable animation = (AnimationDrawable)view.getBackground();
        animation.start();
    }


}
